home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
ansi
/
ansit100.zip
/
ANSITUT.DOC
< prev
next >
Wrap
Text File
|
1992-05-01
|
12KB
|
231 lines
██████▄
███ ██ ████▄ █▄ ████▄ ██ █▄ █████▄ █████▄ █████▄
███ ██ ██ █ ██ ██ ██ ██ ██ █ ██ █ ██
███▄▄██ ██ █ ██ ██▄▄ ██ █ ██ ██▄▄▄█ ██▄▄▄█ ██▄▄
▓▓▓▓▓▓▓▓▓███░░░▓▓██░░█░██░░▓██░░▓▓██░▓█░▓██░██░░▓█░██░░█░▓██░░▓▓▓▓▓▓▓▓▓▓▓▓
▓▓ ███ ██▄▄█ ██▄▄ ██▄▄▄ ██▄▄█▄▄██ ██ █ ██ █▄ ██▄▄▄▄ ▓▓
▓▓ ▓▓
▓▓ PRESENTS ▓▓
▓▓ ▓▓
▓▓ ANSIT! ANSI driver benchmark ANSI tutorial. ▓▓
▓▓ ▓▓
▓▓ This file is a small ANSI tutorial to give you the ▓▓
▓▓ basics of the ANSI and screen write mechanics. ▓▓
▓▓ It's intended for the ANSIT users, not as a general ▓▓
▓▓ tutorial. This file only scratches the surface, but ▓▓
▓▓ it's enough to make you understand what ANSIT! does. ▓▓
▓▓ ▓▓
▓▓ Copyright (c) 1992 Steve Danielsson ▓▓
▓▓ ▓▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
OVERVIEW OF THIS FILE
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
If you have a clear understanding of what an ANSI driver is, what
it does and how text is written to the screen, you don't really need
to read this file. This is intended to give some basic technical
background information concerning this benchmark.
The contents covers Screen write techniques as well as ANSI escape
sequences. The ANSI driver supplied with DOS is called ANSI.SYS,
when I'm referring to 'ANSI driver' in this text I mean ANSI.SYS or
whatever replacement driver you're using.
Note: If you don't know if you have ANSI.SYS loaded, check your
CONFIG.SYS file, it should include this line
DEVICE=ANSI.SYS
or perhaps something like
DEVICE=C:\DOS\ANSI.SYS
SCREEN OUTPUT
▄▄▄▄▄▄▄▄▄▄▄▄▄
To write text to the screen, MS-DOS calls the ROM BIOS Output
routines. If an ANSI driver (ANSI.SYS) is installed, the driver
intercepts the call, interprets the ANSI escape sequences (if any)
and then calls the ROM BIOS routines.
It's possible to bypass the MS-DOS and BIOS routines by writing
the text directly to the screen, that is; accessing the hardware.
A lot of programs do this to get fast screen writes, but DOS
don't and the drawback is that a program doing this will work
on IBM Hardware Compatible machines only.
Now, the trouble is that the ROM BIOS I/O routines aren't very
fast. To get around this someone came up with the idea to write
an ANSI driver (ANSI.SYS replacement) that did _not_ call the
ROM BIOS to output text, but bypassed the BIOS routines and
wrote directly to the screen. This speeds up the text output and
screen scrolling. Today there are a lot of ANSI.SYS replacements
doing exactly this.
Another way is to write a Software BIOS, install it as a device
driver and let it replace the ROM BIOS I/O routines.
There are some Software BIOS replacements available too.
Obviously, the effectiveness of the routines used to replace
the ROM BIOS routines depend on how well they are written.
If you load an ANSI device driver that _does_ take care of
the output itself you probably won't get a faster output by
also loading a software BIOS replacement.
Where does the ANSIT benchmark come into all this ?
Some of the tests performed by ANSIT measure the text output.
When you run the test you will notice that an ANSI driver
that uses it's own routines to write to screen rather than
calling ROM BIOS will be _very_ much faster than drivers that
don't (for example the original ANSI.SYS).
Common sense tells us there's no reason to choose an ANSI
driver that uses the ROM BIOS output routines.
To find out who wrote the fastest replacement routines, you
got ANSIT.
ANSI ESCAPE SEQUENCES
The reason the ANSI.SYS driver exists is to parse and interpret
ANSI escape sequences. So what is that ?
American National Standards Institute (ANSI) has approved
a series of Escape Sequences used to define functions for
intelligent computer terminals. This was originally intended
as a "data terminal standard" for mainframe terminals.
Actually there isn't any terminal in existance that is completely
ANSI standard (the DEC VT-100 terminal come pretty close, though).
As usual the dream of standardization is just a dream, the
equipment manufacturers want to "develop" their products and
the development make them unique, that is; non-standard.
Movement of the cursor, graphics functions and setting the
graphics mode are among the functions availible. The two
first are the ones that concern us here. To make MS/PC-DOS
machines (somewhat) ANSI compatible, the ANSI driver is loaded.
The ANSI device driver is really a filter between DOS and the
hardware, intercepting all screen output, searching it for ANSI
escape sequences, parsing and executing them, if any.
An ANSI escape sequence is a series of characters beginning
with an Escape (ASCII code 27).
What the ANSI.SYS driver (or replacement driver) does is to
interpret these escape sequences and perform the actions or
functions defined for each sequence.
For example the sequence: ESC [2J is the ANSI sequence to
clear the screen (called 'ED' = Erase Display).
The ANSI-driver filters all characters from the keyboard
(or from STDIN actually) and when an escape sequence is
encountered, the driver performs the action (in this case,
clears the screen) instead of writing the escape sequence to
the screen. DOS reads a file, for example, and sends the text
in the file to the screen via the ROM BIOS (Binary Input/Output
System) routines. When the "invisible" ANSI driver finds the
escape sequence it intercepts it and performs the action defined
by the ANSI commitee instead of passing the characters on to the
ROM BIOS.
If you like to see what (and how much) the ANSI driver
interprets for you, REMark the line in your CONFIG.SYS that
loads the ANSI driver you're using, reboot your machine and
try TYPEing the ANSI file included with this program called
TYPEME.ANS. Since there isn't any ANSI driver to interpret all
the Escape Sequences in the file, all of them will be written
to the screen, and it will _not_ look pretty.
Then, un-REMark the line in CONFIG.SYS, reboot your machine to
load the ANSI driver again, and try TYPEing the file.
The result is the interpreted ANSI and the output is alot
better looking.
A common ANSI escape sequence is the one used to set the text
and background colors. Think for awhile, every time a color is
changed on the screen (using ANSI) an escape sequence is sent
to the driver. The sequence we're talking about (SGR) is 6
characters long. If the color is changed 30 times in a full
screen write the driver has to interpret 180 extra characters.
Needless to say, this takes time. T